home *** CD-ROM | disk | FTP | other *** search
/ Internet Surfer: Getting Started / Internet Surfer - Getting Started (Wayzata Technology)(7231)(1995).bin / pc / mac / bonus / peter_le / finger-1 / my_units / myhandle.uni < prev    next >
Text File  |  1992-02-24  |  1KB  |  60 lines

  1. unit MyHandleQuitBoth;
  2.  
  3. { This code is part of the Finger/Fingerd source code, written in THINK Pascal 4 }
  4. { Copyright 1991-1992 Peter N Lewis }
  5. { If you use this code, you must give me credit in your about box and documentation }
  6. { This is part of my generic library of routines }
  7.  
  8. interface
  9.  
  10.     procedure InitQuitBoth (creator: OSType);
  11.     procedure FinishQuitBoth;
  12.  
  13. implementation
  14.  
  15.     uses
  16.         BaseGlobals, MySystem7, MyFMenus, AppGlobals;
  17.  
  18.     var
  19.         quitBoth: boolean;
  20.         creatorType: OSType;
  21.  
  22.     procedure DoQuit;
  23.     begin
  24.         quitNow := true;
  25.         if quitBoth then
  26.             QuitApplication(creatorType);
  27.     end;
  28.  
  29.     procedure SetQuit (themenu, theitem: integer);
  30.         var
  31.             dummyb: boolean;
  32.             er: eventRecord;
  33.             nqb: boolean;
  34.             process: processSerialNumber;
  35.             s: str255;
  36.     begin
  37.         dummyb := GetOSEvent(0, er);
  38.         nqb := (BAND(er.modifiers, optionKey) <> 0) & GetPSN(creatorType, process);
  39.         if nqb <> quitBoth then begin
  40.             quitBoth := nqb;
  41.             if quitBoth then
  42.                 GetIndString(s, quitBothStrhID, quitBothQuitBothStrhIndex)
  43.             else
  44.                 GetIndString(s, quitBothStrhID, quitBothQuitStrhIndex);
  45.             SetItem(GetMHandle(themenu), theitem, s);
  46.         end;
  47.     end;
  48.  
  49.     procedure InitQuitBoth (creator: OSType);
  50.     begin
  51.         quitBoth := false;
  52.         creatorType := creator;
  53.         SetFBoth(CQuit, @DoQuit, @SetQuit);
  54.     end;
  55.  
  56.     procedure FinishQuitBoth;
  57.     begin
  58.     end;
  59.  
  60. end.